<!--
 * @Descripttion:
 * @version:
 * @Author: caiailing
 * @Date: 2023-03-29 14:42:43
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-04-07 15:55:54
-->
<script lang="ts" setup>
import { useInit } from '@/hooks/useInit'
import { forward } from '@/utils/router/router'
const userStore = useStore('user')
const loginOut = () => {
  uni.showModal({
    title: '提示',
    content: '确定要退出登录吗',
    success: (res) => {
      if (res.confirm) {
        userStore.logout()
        forward('login')
      }
    }
  })
}

onLoad(() => {
  const { pageName, pagePath, pageQuery } = useInit()
  // console.log(pageName, pagePath, pageQuery, 'pageName,pagePath, pageQuery')
})
</script>

<template>
  <view @click="loginOut">
    <button>退出登录</button>
  </view>
</template>

<style lang="scss" scoped>
::v-deep .u-tabbar {
  color: red;
  .u-tabbar-item__icon {
    color: red;
    .u-page__item__slot-icon {
      width: 40rpx !important;
      height: 40rpx !important;
    }
  }
}
</style>
